<template>
  <div class="group-item" v-if="item">
    <div class="img-box">
      <img src="@/../public/images/group_default.png" alt="分组图片" />
      <van-icon @click.stop="$emit('deleteGroupItem',item)" class="icon" name="cross" />
    </div>
    <div class="title my-text">{{ item.title }}</div>
    <div class="count">0</div>
  </div>
</template>

<script>
export default {
  props: ["item"],
};
</script>

<style lang="scss" scoped>
.group-item {
  width: 1.8rem;
  height: 2.34rem;
  border-radius: 0.12rem;
  overflow: hidden;
  background-color: var(--bgc-white);
  box-sizing: border-box;
  padding: 0.08rem;
  .img-box {
    position: relative;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 0.12rem;
    overflow: hidden;
    background-color: var(--bgc-gray2);
    .icon {
      position: absolute;
      font-size: 0.25rem;
      color: var(--text-gray);
      z-index: 1;
      right: 0.04rem;
      top: 0.06rem;
      opacity: 0.5;
    }
  }
  .title {
    font-size: 0.15rem;
    line-height: 0.3rem;
    color: var(--text-black);
  }
  .count {
    font-size: 0.12rem;
    color: var(--text-gray2);
  }
}
</style>